<?php require('connections/con_gl.php'); ?>
<?php
cekAkses($_SESSION[akses],"PD-3-1");

mysql_select_db($database_con_gl, $con_gl);
$query_klas1 = "SELECT id, gudang FROM gl_gudang ORDER BY gudang ASC";
$klas1 = mysql_query($query_klas1, $con_gl) or die(mysql_error());
$row_klas1 = mysql_fetch_assoc($klas1);
$totalRows_klas1 = mysql_num_rows($klas1);

?>
<link href="ccss/ui.datepicker.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="js/ui.datepicker.js"></script>
<script type="text/javascript">
<!--
$(function()
      {
        $('.calendar').datepicker({
            appendText : "",
            dateFormat : 'yy/mm/dd'
          });
      });
	  
</script>
<script type="text/javascript" src="js/ajax_data.js"></script>
<script type="text/javascript">
$(document).ready(function() {

	$().ajaxStart(function() {
		$('#loading').show();
		$('#result').hide();
	}).ajaxStop(function() {
		$('#loading').hide();
		$('#result').fadeIn('slow');
	});

	$('#add').submit(function() {
		$.ajax({
			type: 'POST',
			url: $(this).attr('action'),
			data: $(this).serialize(),
			success: function(data) {
				$('#result').html(data);
			}
		})
		return false;
	});
  $('#result').click(function(){
  $(this).hide();
  });
})
</script>
<div id="loading" style="display:none;"><img src="images/loading.gif" alt="loading..." /></div>
<div id="result" style="display:none;"></div>
<h1>Tambah Data Customer Retail Personal </h1>
<form action="proses/customerretail.php?act=add" method="POST" name="add" id="add" >
  <table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">
    
    <tr>
      <td align="right">&nbsp;</td>
      <td align="right" bgcolor="#DDDDDD"><div align="left">Biodata Customer </div></td>
      <td bgcolor="#DDDDDD">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#DDDDDD">Status Customer </td>
      <td bgcolor="#DDDDDD">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr>
      <td width="7%" align="right" bgcolor="#FFFFFF">&nbsp;</td>
      <td align="right" valign="top" bgcolor="#FFFFFF">Nama* : </td>
      <td valign="top" bgcolor="#FFFFFF"><label>
        <input name="nama" type="text" id="nama" size="37" maxlength="100" />
      </label></td>
      <td width="2%" bgcolor="#FFFFFF">&nbsp;</td>
      <td width="17%" bgcolor="#FFFFFF"><div align="right">Tanggal Daftar : </div></td>
      <td width="23%" bgcolor="#FFFFFF"><input name="tgldaftar" type="text" class="calendar" id="tgldaftar" value="<?php echo date("Y/m/d"); ?>" size="15" maxlength="15"/></td>
      <td width="12%" bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr valign="top">
      <td align="right" bgcolor="#FFFFFF">&nbsp;</td>
      <td align="right" bgcolor="#FFFFFF">Jenis Kelamin : </td>
      <td bgcolor="#FFFFFF"><select name="jeniskelamin" id="jeniskelamin">
          <option value="PRIA">PRIA</option>
          <option value="WANITA">WANITA</option>
      </select></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF"><div align="right">Daftar di cabang: </div></td>
      <td bgcolor="#FFFFFF"><select name="cabang" id="cabang">
      <option value="">Pilih Kantor / Cabang</option>
        <?php
do {  
?>
        <option value="<?php echo $row_klas1['id']?>"><?php echo $row_klas1['gudang']?></option>
        <?php
} while ($row_klas1 = mysql_fetch_assoc($klas1));
  $rows = mysql_num_rows($klas1);
  if($rows > 0) {
      mysql_data_seek($klas1, 0);
	  $row_klas1 = mysql_fetch_assoc($klas1);
  }
?>
      </select></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    
    <tr valign="top">
      <td align="right" bgcolor="#FFFFFF">&nbsp;</td>
      <td align="right" bgcolor="#FFFFFF">Tempat &amp; Tanggal Lahir : </td>
      <td bgcolor="#FFFFFF"><input name="tempatlahir" type="text" id="tempatlahir" size="18" maxlength="100" />
          <input name="tgllahir" type="text" class="calendar" id="tgllahir" value="<?php echo date("Y/m/d"); ?>" size="15" maxlength="15"/></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF"><div align="right">Status Customer : </div></td>
      <td bgcolor="#FFFFFF"><select name="statuscustomer" id="statuscustomer">
          <option value="AKTIF">AKTIF</option>
          <option value="TIDAK AKTIF">TIDAK AKTIF</option>
          <option value="BLACK LIST">BLACK LIST</option>
      </select></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr valign="top">
      <td align="right" bgcolor="#FFFFFF">&nbsp;</td>
      <td align="right" bgcolor="#FFFFFF">Alamat* : </td>
      <td rowspan="2" bgcolor="#FFFFFF"><textarea name="alamat" cols="35" rows="3" id="alamat"></textarea>
          <input name="id3" type="hidden" id="id3" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF"><div align="right">Keterangan : </div></td>
      <td rowspan="2" bgcolor="#FFFFFF"><textarea name="keterangan" cols="35" rows="3" id="keterangan"></textarea>
        <input name="id32" type="hidden" id="id32" /></td>
      <td rowspan="3" bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr valign="top">
      <td align="right" bgcolor="#FFFFFF">&nbsp;</td>
      <td align="right" bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr valign="top">
      <td align="right" bgcolor="#FFFFFF">&nbsp;</td>
      <td align="right" bgcolor="#FFFFFF">Telp/HP* : </td>
      <td bgcolor="#FFFFFF"><input name="tlp" type="text" id="tlp" size="37" maxlength="100" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#DDDDDD">Data Referensi </td>
      <td bgcolor="#DDDDDD">&nbsp;</td>
    </tr>
    
    
    <tr>
      <td align="right" bgcolor="#FFFFFF">&nbsp;</td>
      <td align="right" bgcolor="#FFFFFF">Fax : </td>
      <td bgcolor="#FFFFFF"><input name="fax" type="text" id="fax" size="37" maxlength="100" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF"><div align="right">Nama Referensi : </div></td>
      <td bgcolor="#FFFFFF"><input name="nama1" type="text" id="nama1" size="37" maxlength="100" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr>
      <td align="right" bgcolor="#FFFFFF">&nbsp;</td>
      <td align="right" bgcolor="#FFFFFF">email : </td>
      <td bgcolor="#FFFFFF"><input name="email" type="text" id="email" size="18" maxlength="100" />
          <input name="id" type="hidden" id="id" />
        Format : abc@xx.com</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF"><div align="right">Alamat : </div></td>
      <td rowspan="2" bgcolor="#FFFFFF"><textarea name="alamat1" cols="35" rows="3" id="alamat1"></textarea>
        <input name="id33" type="hidden" id="id33" /></td>
      <td rowspan="3" bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr>
      <td align="right" bgcolor="#FFFFFF">&nbsp;</td>
      <td align="left" bgcolor="#FFFFFF"><div align="right">NPWP : </div></td>
      <td bgcolor="#FFFFFF"><input name="npwp" type="text" id="npwp" size="37" maxlength="100" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    
    
    <tr>
      <td align="left" bgcolor="#FFFFFF">&nbsp;</td>
      <td align="left" bgcolor="#FFFFFF"><div align="right">No. KTP*  :</div></td>
      <td bgcolor="#FFFFFF"><input name="ktp" type="text" id="ktp" size="37" maxlength="100" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF"><div align="right">Telp/HP .: </div></td>
      <td bgcolor="#FFFFFF"><input name="tlp1" type="text" id="tlp1" size="37" maxlength="100" /></td>
    </tr>
    <tr>
      <td align="left" bgcolor="#FFFFFF">&nbsp;</td>
      <td align="left" bgcolor="#FFFFFF"><div align="right">Masa berlaku KTP* : </div></td>
      <td bgcolor="#FFFFFF"><input name="masaberlakuktp" type="text" class="calendar" id="masaberlakuktp" value="<?php echo date("Y/m/d"); ?>" size="15" maxlength="15"/></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    
    <tr>
      <td align="left" bgcolor="#FFFFFF">&nbsp;</td>
      <td align="left" bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    
    <tr>
      <td align="left" bgcolor="#FFFFFF">&nbsp;</td>
      <td align="left" bgcolor="#FFFFFF"><em>*Harus diisi</em></td>
      <td bgcolor="#FFFFFF"><label>
        <input name="Save" type="submit" id="Save" value="Simpan" />
        </label>
          <label>
          <input type="button" name="Button" value="Batal" onClick="javascript:history.go(-1);">
        </label></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
  </table>
</form>
